package com.lagou.mapper;

import com.lagou.pojo.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {

    //根据id查询对应的文章
    @Select("SELECT * FROM t_article WHERE id = #{id}")
    public Article selectArticle(Integer id);

    /**
     * 分页查询Article
     * @return
     */
    @Select("SELECT * FROM t_article Limit #{pageNow} , #{pageSize}")
    List<Article> selectPage(@Param("pageNow") Integer pageNow,@Param("pageSize") Integer pageSize);


}
